package com.sgq.vue.entity.system;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.sgq.vue.entity.base.MyBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author SGQ
 * @since 2023-10-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_permission")
public class Permission extends MyBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 权限名称
     */
    private String label;

    /**
     * 父权限ID
     */
    private Long parentId;

    /**
     * 父权限名称
     */
    private String parentName;

    /**
     * 授权标识符
     */
    private String code;

    /**
     * 路由地址
     */
    private String path;

    /**
     * 路由名称
     */
    private String name;

    /**
     * 授权路径
     */
    private String url;

    /**
     * 权限类型(0-目录 1-菜单 2-按钮)
     */
    private Integer type;

    /**
     * 图标
     */
    private String icon;


    /**
     * 排序
     */
    private Integer orderNum;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL) //属性值为null的不进行序列化
    private List<Permission> children = new ArrayList<>();

    /**
     *  用于判断是按钮,菜单,目录
     */
    @TableField(exist = false)
    private String value;

    /**
     *  是否展开
     */
    @TableField(exist = false)
    private Boolean open;
}
